package main

import (
	"fmt"
	"leetCode/homework/week1"
)

func main() {
	// 测试删除
	fmt.Printf("========测试删除========\n")
	s1 := week1.NewTSlice[int](0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
	//s := week1.NewTSlice[int](1, 2)
	s1.Print()
	s1.Delete(1)
	s1.Print()

	// 测试<256的收缩
	fmt.Printf("========测试<256的收缩========\n")
	s2 := week1.NewTSlice[int](0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
	s2.Print()
	for i := 0; i < 150; i++ {
		s2.Append(0)
	}
	for i := 0; i < 200; i++ {
		s2.Delete(11)
	}
	s2.Shrink()
	s2.Print()

	// 测试>256的收缩
	fmt.Printf("========测试>256的收缩========\n")
	s3 := week1.NewTSlice[int](0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
	s3.Print()
	for i := 0; i < 1000; i++ {
		s3.Append(0)
	}
	for i := 0; i < 800; i++ {
		s3.Delete(11)
	}
	s3.Shrink()
	s3.Print()

}
